#!/bin/bash

JAVAPATH="/opt/IBMJava2-131/jre/bin/"
x=`type -p java 2>/dev/null`
if [ "$x" != "" ]
then
  JAVAPATH=`/usr/bin/dirname $x`
fi
SAVED_CLASSPATH=$CLASSPATH
if [ "${DEBUG_JARS_DIRECTORY}" != "" ] ; then
  if [ -d ${DEBUG_JARS_DIRECTORY} ] ; then
    for i in ${DEBUG_JARS_DIRECTORY}/*.jar
    do
       debug_jars=${debug_jars}:$i
    done
  fi
fi

CLASSPATH=${DEBUG_JARS_DIRECTORY}:${debug_jars}:/usr/websm/codebase/pluginjars/hsc.jar:/usr/websm/codebase/wsm.jar:/usr/websm/codebase/pluginjars/sniacimom.jar:/usr/websm/codebase/pluginjars/xerces.jar:/usr/websm/codebase/pluginjars/HwmcaCommon.jar:/usr/websm/codebase/pluginjars/auifw.jar:/usr/websm/codebase/pluginjars/rmcjava.jar:$CLASSPATH 
export CLASSPATH
export PATH=$JAVAPATH:$PATH
export LD_LIBRARY_PATH=/opt/hsc/lib/hmcjni:$LD_LIBRARY_PATH
#echo $CLASSPATH

java -Djavax.net.ssl.keyStore=/usr/websm/codebase/SM.pubkr -Djavax.net.ssl.keyStorePassword=defp -Dorg.snia.wbem.cimom.properties=/opt/hsc/data/cim.properties com.ibm.hsc.common.util.ListHSC ${1} ${2} ${3} ${4} ${5} ${6} ${7} ${8} ${9} 
# Note, for the above command, 9 command line arguments should be sufficient
LSHSC_RC=$?

CLASSPATH=SAVED_CLASSPATH
export CLASSPATH

exit $LSHSC_RC
